package com.quectel.business.common.mobileuser;

import com.quectel.core.module.mobileuser.service.MobileUserService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * 在这里编写说明
 *
 * @author: bob
 * @email: bob.yu@quectel.com
 * @date: 2023-05-18 10:42:00
 */
@Component
public class MobileUserBusiness {

    @DubboReference
    private MobileUserService mobileUserService;

    /**
     * 通过名称搜索 B端 + C端用户
     * 查询返回用户id列表
     */
    public List<Long> getIdList(String name){

        List<Long> ids = new ArrayList<>();
        // 搜索mobileUser
        List<Long> mobilePerson = mobileUserService.queryMobilePerson(name);
        if (CollectionUtils.isNotEmpty(mobilePerson)){
            ids.addAll(mobilePerson);
        }
        return ids;
    }

}
